/**
 * @License: (C) Copyright 2013-2022
 * @Contact: abcque@outlook.com
 * @IDE: IntelliJ IDEA
 * @Encoding: utf-8
 * @Project: st2212 2213
 * @Package: PACKAGE_NAME
 * @File: TwoDimensionInitial.java
 * @Time: 2022/12/15 15:09
 * @Author: abcque
 * @Description: 二维数组的初始化
 * @Modifier:
 * @ModifyDate:
 * @ModifyRemark:
 */
public class TwoDimensionInitial {
    public static void main(String[] args) {
        /*int[][] arr;
        // 规则形状的数组
        arr = new int[3][2];
        arr[0][0] = 0;
        arr[0][1] = 1;

        arr[1][0] = 2;
        arr[1][1] = 3;

        arr[2][0] = 4;
        arr[2][1] = 5;

        // 数组名.length 数组的长度，即第一维长度
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.println("arr[i][i] = " + arr[i][j]);
            }
        }*/

        /*int[][] arr;

        arr = new int[3][];
        arr[0] = new int[2];
        arr[1] = new int[3];
        arr[2] = new int[4];

        arr[0][0] = 0;
        arr[0][1] = 1;

        arr[1][0] = 2;
        arr[1][1] = 3;
        arr[1][2] = 4;

        arr[2][0] = 5;
        arr[2][1] = 6;
        arr[2][2] = 7;
        arr[2][3] = 8;*/

        // int[][] arr = new int[][]{{1, 2}, {3, 4}, {5, 6}};
        int[][] arr = {{1, 2}, {3, 4}, {5, 6}};

    }
}
